package com.woniu.api;

import com.woniu.entity.Product;
import com.woniu.hystrix.FallbackFactoryCommand;
import com.woniu.entity.ProductDTO;
import com.woniu.entity.utils.ResponseEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

/**
 * @Author WY
 * @PackageName phase-iv-cyx
 * @Package com.woniu.api使用OpenFeign对远程product服务进行调用，接口
 * @Date 2022/12/7 11:06
 * @Version 1.0
 */
@FeignClient(value = "cyx-product")
@RequestMapping("/product")
public interface RemoteProductServe {
    @GetMapping("/{pid}")
    ResponseEntity findOneByPid(@PathVariable("pid") Integer pid);
    @PutMapping("/")
    ResponseEntity updateProduct(@RequestBody Product product);
    //    @GetMapping("/findCondition")
//    public ResponseEntity findAllByNameOrPrice(@RequestParam("name") String name,@RequestParam("minPrice") double minPrice,
//                                               @RequestParam("maxPrice") double maxPrice);
//    @GetMapping("/findCondition")
//    public ResponseEntity findAllByNameOrPrice1(@SpringQueryMap Map map);
    @GetMapping("/findCondition")
    public ResponseEntity findAllByNameOrPrice1(@SpringQueryMap ProductDTO productDTO);

}
